import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import VueResource from 'vue-resource'

import ElementUI from '_element-ui@2.15.2@element-ui'
import 'element-ui/lib/theme-chalk/index.css';
import '@/plugins/element.js'
// 导入全局样式
import '@/css/global.scss'
import '@/css/flex/flex.scss'
// 导入myPlugin
import myPlugin from '@/plugins/myPlugin.js'
// 导入图标
import '@/css/ico/iconfont.css'
// 转化时间戳
import moment from "moment"


Vue.use(ElementUI)
Vue.use(myPlugin)
Vue.use(VueResource);

Vue.prototype.$moment = moment;
Vue.config.productionTip = false

Vue.filter('moment', function(value, formatString) {
    // formatString = formatString || 'YYYY年MM月DD日';
    formatString = "YYYY-MM-DD HH:mm:ss"

    // 普通日期(20200202)转时间
    // return moment(value).format(formatString);

    // 这是时间戳转时间
    return moment.unix(value).format(formatString);
});

//格式可自定义 YYYY-MM-DD HH:MM:SS  || YYYY/MM/DD 等

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')